package com.zc.demo.datasource;

import com.zc.dao.DemoDao;
import com.zc.demo.util.BaseTest;
import com.zc.domain.po.Demo;
import com.zc.service.DemoService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by zhangchi9 on 2016/11/8.
 */
public class MyBatis extends BaseTest{

    @Autowired
    private DemoService demoService;
    @Test
    public void selecttest(){
        Demo demo = new Demo();
        demo.setName("测试");
        demo.setStpositionRule(1);
        demo.setStpositionValue(Float.parseFloat("2"));
        demoService.addDemo(demo);
    }
    @Test
    public void testAnnotation(){
        Demo demo = new Demo();
        demo.setName("注解");
        demo.setStpositionRule(1);
        demo.setStpositionValue(Float.parseFloat("1"));
        demoService.gainDemo(demo);
    }
}
